package tegneprogram;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;

/**
 *
 * @author Franz
 */
public class Line {

    private Point point1;
    private Point point2;
    private Color c;

    public Line(Point point1, Point point2, Color c) {
        this.c = c;
        this.point1 = point1;
        this.point2 = point2;
    }

    public void draw(Graphics g) {
        g.setColor(c);
        g.drawLine(point1.x, point1.y, point2.x, point2.y);
    }
    
    @Override
    public String toString(){
        return "1,"+point1.x+","+point1.y+","+point2.x+","+point2.y+","+c.getRGB();
    }
}
